EXECUTABLE := test

LIBS := 
INCS := 

LIBPATHS :=

CFLAGS = -Wall -O0 -g 
CC = g++

SOURCE := $(wildcard *.cpp *.c)
OBJS_PATH := ./.obj
OBJS := $(patsubst %.cpp,$(OBJS_PATH)/%.o,$(SOURCE))

$(OBJS_PATH)/%.o:%.cpp | $(OBJS_PATH)
	$(CC) $(CFLAGS)  $(addprefix -I,$(INCS)) -c $< -o $@

$(EXECUTABLE): $(OBJS)
	$(CC) $(CFLAGS)  -o $(EXECUTABLE) $(OBJS) $(addprefix -L, $(LIBPATHS))

clean :  
	rm -rf *~?? core* *.d *.o *.lo *bak $(OBJS) $(EXECUTABLE)
     
realclean: clean
	rm -rf *.o *.d *.lo  $(OBJS) $(EXECUTABLE)  

$(sort $(OBJS_PATH)):
	mkdir -p $@
